/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package ar.edu.utn.frsf.cidisi.upcolbpip.interactionprotocols;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import org.eclipse.emf.common.util.Enumerator;

/**
 * <!-- begin-user-doc -->
 * A representation of the literals of the enumeration '<em><b>Synchronization Type</b></em>',
 * and utility methods for working with them.
 * <!-- end-user-doc -->
 * @see ar.edu.utn.frsf.cidisi.upcolbpip.interactionprotocols.InteractionprotocolsPackage#getSynchronizationType()
 * @model
 * @generated
 */
public enum SynchronizationType implements Enumerator {
	/**
	 * The '<em><b>Synchronizing Merge</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #SYNCHRONIZING_MERGE_VALUE
	 * @generated
	 * @ordered
	 */
	SYNCHRONIZING_MERGE(0, "SynchronizingMerge", "<<Sync-Merge>>"),

	/**
	 * The '<em><b>Discriminator</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #DISCRIMINATOR_VALUE
	 * @generated
	 * @ordered
	 */
	DISCRIMINATOR(1, "Discriminator", "<<Disc>>"),

	/**
	 * The '<em><b>NOut Of M</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #NOUT_OF_M_VALUE
	 * @generated
	 * @ordered
	 */
	NOUT_OF_M(2, "NOutOfM", "<<N-out-of-M>>"),

	/**
	 * The '<em><b>Multi Merge</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #MULTI_MERGE_VALUE
	 * @generated
	 * @ordered
	 */
	MULTI_MERGE(3, "MultiMerge", "<<Multi-Merge>>");

	/**
	 * The '<em><b>Synchronizing Merge</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>Synchronizing Merge</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #SYNCHRONIZING_MERGE
	 * @model name="SynchronizingMerge" literal="<<Sync-Merge>>"
	 * @generated
	 * @ordered
	 */
	public static final int SYNCHRONIZING_MERGE_VALUE = 0;

	/**
	 * The '<em><b>Discriminator</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>Discriminator</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #DISCRIMINATOR
	 * @model name="Discriminator" literal="<<Disc>>"
	 * @generated
	 * @ordered
	 */
	public static final int DISCRIMINATOR_VALUE = 1;

	/**
	 * The '<em><b>NOut Of M</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>NOut Of M</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #NOUT_OF_M
	 * @model name="NOutOfM" literal="<<N-out-of-M>>"
	 * @generated
	 * @ordered
	 */
	public static final int NOUT_OF_M_VALUE = 2;

	/**
	 * The '<em><b>Multi Merge</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>Multi Merge</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #MULTI_MERGE
	 * @model name="MultiMerge" literal="<<Multi-Merge>>"
	 * @generated
	 * @ordered
	 */
	public static final int MULTI_MERGE_VALUE = 3;

	/**
	 * An array of all the '<em><b>Synchronization Type</b></em>' enumerators.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static final SynchronizationType[] VALUES_ARRAY =
		new SynchronizationType[] {
			SYNCHRONIZING_MERGE,
			DISCRIMINATOR,
			NOUT_OF_M,
			MULTI_MERGE,
		};

	/**
	 * A public read-only list of all the '<em><b>Synchronization Type</b></em>' enumerators.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static final List<SynchronizationType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));

	/**
	 * Returns the '<em><b>Synchronization Type</b></em>' literal with the specified literal value.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static SynchronizationType get(String literal) {
		for (int i = 0; i < VALUES_ARRAY.length; ++i) {
			SynchronizationType result = VALUES_ARRAY[i];
			if (result.toString().equals(literal)) {
				return result;
			}
		}
		return null;
	}

	/**
	 * Returns the '<em><b>Synchronization Type</b></em>' literal with the specified name.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static SynchronizationType getByName(String name) {
		for (int i = 0; i < VALUES_ARRAY.length; ++i) {
			SynchronizationType result = VALUES_ARRAY[i];
			if (result.getName().equals(name)) {
				return result;
			}
		}
		return null;
	}

	/**
	 * Returns the '<em><b>Synchronization Type</b></em>' literal with the specified integer value.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static SynchronizationType get(int value) {
		switch (value) {
			case SYNCHRONIZING_MERGE_VALUE: return SYNCHRONIZING_MERGE;
			case DISCRIMINATOR_VALUE: return DISCRIMINATOR;
			case NOUT_OF_M_VALUE: return NOUT_OF_M;
			case MULTI_MERGE_VALUE: return MULTI_MERGE;
		}
		return null;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private final int value;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private final String name;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private final String literal;

	/**
	 * Only this class can construct instances.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private SynchronizationType(int value, String name, String literal) {
		this.value = value;
		this.name = name;
		this.literal = literal;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getValue() {
	  return value;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getName() {
	  return name;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getLiteral() {
	  return literal;
	}

	/**
	 * Returns the literal value of the enumerator, which is its string representation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		return literal;
	}
	
} //SynchronizationType
